Event.observe(window, 'load', function() {TestLoader.attachEvents();});

var TestLoader = {
  attachEvents: function() {
    this.nav = $$('#nav ul')[0];
    Event.observe(this.nav, 'click', this.onClick.bindAsEventListener(this));
  },
  onClick: function(event) {
    var source = Event.element(event);
    if (source.tagName == 'A') {
      this.loadTest(source.href);
      Event.stop(event);
    }
  },
  loadTest: function(url) {
    if (!this.iframe) this.buildFrame();
    this.iframe.src = url;
  },
  buildFrame: function() {
    this.iframe = document.createElement('iframe');
    var content = $('content');
    content.update();
    content.appendChild(this.iframe);
  }
};